<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>小马出行后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="icon" href="/favicon.ico">
    <link rel="stylesheet" href="__CSS__/layui.css"  media="all">
    <link rel="stylesheet" href="__CSS__/main.css"  media="all">
</head>
<style>
    .top_menu.layui-nav .layui-this a {
        color: #FF5722
    }
</style>
<body class="main_body">
<div class="layui-layout layui-layout-admin">
    <!-- 顶部 -->
    <div class="layui-header header">
        <div class="layui-main">
            <a href="#" class="logo"><img src="__PUBLIC__/images/logo1.png" alt="" style="width: 100%"></a>
            <!-- 显示/隐藏菜单 -->
            <a href="javascript:;" class="iconfont hideMenu"><i class="layui-icon">&#xe603;</i></a>


            <!-- 天气信息 -->
            <div class="weather" pc>
                <div id="tp-weather-widget"></div>
                <script>(function (T, h, i, n, k, P, a, g, e) {
                    g = function () {
                        P = h.createElement(i);
                        a = h.getElementsByTagName(i)[0];
                        P.src = k;
                        P.charset = "utf-8";
                        P.async = 1;
                        a.parentNode.insertBefore(P, a)
                    };
                    T["ThinkPageWeatherWidgetObject"] = n;
                    T[n] || (T[n] = function () {
                        (T[n].q = T[n].q || []).push(arguments)
                    });
                    T[n].l = +new Date();
                    if (T.attachEvent) {
                        T.attachEvent("onload", g)
                    } else {
                        T.addEventListener("load", g, false)
                    }
                }(window, document, "script", "tpwidget", "//widget.seniverse.com/widget/chameleon.js"))</script>
                <script>tpwidget("init", {
                    "flavor": "slim",
                    "location": "WX4FBXXFKE4F",
                    "geolocation": "enabled",
                    "language": "zh-chs",
                    "unit": "c",
                    "theme": "chameleon",
                    "container": "tp-weather-widget",
                    "bubble": "disabled",
                    "alarmType": "badge",
                    "color": "#FFFFFF",
                    "uid": "U9EC08A15F",
                    "hash": "039da28f5581f4bcb5c799fb4cdfb673"
                });
                tpwidget("show");</script>
            </div>

            <ul class="layui-nav top_menu" lay-filter="" style="left:600px" id="main_menu">
                <volist name="menu_list" id="v" key="k">
                    <li class="layui-nav-item <if condition='$k eq 1'>layui-this</if>" data-type="{$key}"
                        onclick="main_menu(this)"><a href="javascript:;">{$v.name}</a></li>
                </volist>
                <!-- 	<li class="layui-nav-item layui-this" data-type="inside" onclick="main_menu(this)" ><a href="javascript:;">城内小马</a></li>
                    <li class="layui-nav-item" data-type="outside" onclick="main_menu(this)" ><a href="javascript:;">城际</a></li>
                    <li class="layui-nav-item" data-type="bus" onclick="main_menu(this)" ><a href="javascript:;">大巴</a></li> -->
            </ul>
            <!-- 顶部右侧菜单 -->
            <ul class="layui-nav top_menu">
                <!--   	<li class="layui-nav-item showNotice" id="showNotice" >
                          <a href="javascript:;"><i class="iconfont icon-gonggao"></i><cite>系统公告</cite></a>
                      </li> -->

                <!-- 	<li class="layui-nav-item lockcms" pc>
                        <a href="javascript:;"><i class="iconfont icon-lock1"></i><cite>锁屏</cite></a>
                    </li> -->
                <li class="layui-nav-item">
                    <a href="javascript:;">

                        <cite>{$admin_info.user_name}</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="javascript:;" data-url="{:url('admin/selfInfo')}"><i class="iconfont icon-zhanghu"
                                                                                          data-icon="icon-zhanghu"></i><cite>个人资料</cite></a>
                        </dd>
                        <dd>
                            <a href="javascript:;" data-url="{:url('admin/modify_pwd')}"><i
                                    class="iconfont icon-shezhi1" data-icon="icon-shezhi1"></i><cite>修改密码</cite></a>
                        </dd>
                        <dd>
                            <a href="javascript:;" class="changeSkin"><i
                                    class="iconfont icon-huanfu"></i><cite>更换皮肤</cite></a>
                        </dd>
                        <dd>
                            <a href="{:U('Admin/logout')}" class="signOut"><i class="iconfont icon-loginout"></i><cite>退出</cite></a>
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <!-- 左侧导航 -->
    <div class="layui-side layui-bg-black">

        <div class="navBar layui-side-scroll">
            <ul class="layui-nav layui-nav-tree">
                <!-- <li class="layui-nav-item">
                    <a href="javascript:;" data-url="{:url('index/main')}">
                        <i class="layui-icon">&#xe68e;</i>
                        <cite>后台首页</cite>
                    </a>
                </li> -->
                <foreach name="menu_list" item="val" key="key">
                    <foreach name="val['child']" item="vo" key="k">
                        <li class="layui-nav-item nav_{$key}"
                        <if condition="$key neq $firstkey_v"> style="display:none"</if>
                        >
                        <a href="javascript:;">
                            <i class="layui-icon">{$vo['icon']}</i><cite>{$vo['name']}</cite><span
                                class="layui-nav-more"></span>
                        </a>
                        <foreach name="vo.sub_menu" item="vv" key="kk">
                            <dl class="layui-nav-child">
                                <dd>
                                    <a href="javascript:;" data-url='{:U("$vv[control]/$vv[act]")}'>
                                        <i class="layui-icon"></i>
                                        <cite>{$vv.name}</cite>
                                    </a>
                                </dd>
                            </dl>
                        </foreach>
                        </li>
                    </foreach>
                </foreach>
            </ul>
        </div>
    </div>
    <!-- 右侧内容 -->
    <div class="layui-body layui-form">
        <div class="layui-tab marg0" lay-filter="bodyTab" id="top_tabs_box">
            <ul class="layui-tab-title top_tab" id="top_tabs">
                <li class="layui-this" lay-id=""><i class="iconfont icon-computer"></i> <cite>后台首页</cite></li>
            </ul>
            <ul class="layui-nav closeBox">
                <li class="layui-nav-item">
                    <a href="javascript:;"><i class="iconfont icon-caozuo"></i> 页面操作</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" class="refresh refreshThis"><i class="layui-icon">&#x1002;</i>
                            刷新当前</a></dd>
                        <dd><a href="javascript:;" class="closePageOther"><i class="iconfont icon-prohibit"></i>
                            关闭其他</a></dd>
                        <dd><a href="javascript:;" class="closePageAll"><i class="iconfont icon-guanbi"></i> 关闭全部</a>
                        </dd>
                    </dl>
                </li>
            </ul>
            <div class="layui-tab-content clildFrame">
                <div class="layui-tab-item layui-show">
                    <iframe src="{:url('index/main')}"></iframe>
                </div>
            </div>
        </div>
    </div>
    <!-- 底部 -->
    <div class="layui-footer footer">
        <p>Copyright ©2018 好马科技</p>
    </div>
</div>

<!-- 移动导航 -->
<div class="site-tree-mobile layui-hide"><i class="layui-icon">&#xe602;</i></div>
<div class="site-mobile-shade"></div>

<!--<script type="text/javascript" src="__PUBLIC__/newadmin/layui/layui.js"></script>-->
<script type="text/javascript" src="__UI__/layui.js"></script>
<script src='{$protocol}cdn.bootcss.com/socket.io/2.0.3/socket.io.js'></script>
<script type="text/javascript" src="__PUBLIC__/js/index.js"></script>
<script>
    function main_menu(obj) {
        var main_menu = $(obj).data('type');
        $('.nav_inside').hide();
        $('.nav_outside').hide();
        $('.nav_intercity').hide();
        $('.nav_bus').hide();
        $('.nav_system').hide();
        $('.nav_' + main_menu).show();
    }

    //JavaScript代码区域
    layui.use(['element', 'layer'], function () {
        var element = layui.element, layer = layui.layer,index=0;
        var flag = "{$link}";
        if(flag){
            ws = new WebSocket("{$ws}");
            ws.onopen = function (ev) {};
            ws.onmessage = function (e) {
                var data = JSON.parse(e.data);
                index++;
                switch (data['type']){
                    case 'publish':
                        layer.open({
                            type: 1
                            ,title: data['title']
                            ,offset: 'rb' //具体配置参考：http://www.layui.com/doc/modules/layer.html#offset
                            ,id: 'layerDemorb'+index //防止重复弹出
                            ,content: '<div style="padding: 20px 50px 50px;">'+ data['content'] +'</div>'
                            //,btn: '关闭全部'
                            // ,btnAlign: 'c' //按钮居中
                            ,shade: 0 //不显示遮罩
                            ,icon: 1
                            ,cancel: function(ind){
                                index--;
                                layer.close(ind);
                            }
                        });
                        break;
                    case 'login':
                        layer.msg(data['content'],function () {
                            index--;
                        });
                        break;
                    case 'online':
                        ws.send('I am Online');
                        break;
                    default:
                        index--;
                        break;
                }
            };
            ws.onerror = function (ev) {console.log(ev)};
            ws.onclose = function (ev) {console.log(ev)}
        }
    });
</script>
</body>
</html>
